package com.ruoyi.system.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.ZhwyChargeTjHouse;
import com.ruoyi.system.service.IZhwyChargeTjHouseService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 收费统计商铺12Controller
 * 
 * @author ruoyi
 * @date 2024-05-10
 */
@RestController
@RequestMapping("/system/sftjhouse")
public class ZhwyChargeTjHouseController extends BaseController
{
//
    @Autowired
    private IZhwyChargeTjHouseService zhwyChargeTjHouseService;

    /**
     * 查询收费统计商铺12列表
     */
    @PreAuthorize("@ss.hasPermi('system:sftjhouse:list')")
    @GetMapping("/list")
    public TableDataInfo list(ZhwyChargeTjHouse zhwyChargeTjHouse)
    {
//        startPage();
        List<ZhwyChargeTjHouse> list = zhwyChargeTjHouseService.selectZhwyChargeTjHouseList(zhwyChargeTjHouse);
        return getDataTable(list);
    }
//22222222222
//
    /**
     * 导出收费统计商铺12列表
     */
    @PreAuthorize("@ss.hasPermi('system:sftjhouse:export')")
    @Log(title = "收费统计商铺12", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, ZhwyChargeTjHouse zhwyChargeTjHouse)
    {
        List<ZhwyChargeTjHouse> list = zhwyChargeTjHouseService.selectZhwyChargeTjHouseList(zhwyChargeTjHouse);
        ExcelUtil<ZhwyChargeTjHouse> util = new ExcelUtil<ZhwyChargeTjHouse>(ZhwyChargeTjHouse.class);
        util.exportExcel(response, list, "收费统计商铺12数据");
    }

    /**
     * 获取收费统计商铺12详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:sftjhouse:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(zhwyChargeTjHouseService.selectZhwyChargeTjHouseById(id));
    }

    /**
     * 新增收费统计商铺12
     */
    @PreAuthorize("@ss.hasPermi('system:sftjhouse:add')")
    @Log(title = "收费统计商铺12", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ZhwyChargeTjHouse zhwyChargeTjHouse)
    {
        return toAjax(zhwyChargeTjHouseService.insertZhwyChargeTjHouse(zhwyChargeTjHouse));
    }

    /**
     * 修改收费统计商铺12
     */
    @PreAuthorize("@ss.hasPermi('system:sftjhouse:edit')")
    @Log(title = "收费统计商铺12", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ZhwyChargeTjHouse zhwyChargeTjHouse)
    {
        return toAjax(zhwyChargeTjHouseService.updateZhwyChargeTjHouse(zhwyChargeTjHouse));
    }

    /**
     * 删除收费统计商铺12
     */
    @PreAuthorize("@ss.hasPermi('system:sftjhouse:remove')")
    @Log(title = "收费统计商铺12", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(zhwyChargeTjHouseService.deleteZhwyChargeTjHouseByIds(ids));
    }
}
